%namespace myCompiler


alpha                 [a-zA-Z]+
digits                [0-9]+
ScreenOut             screenout 
SetString             setstring 
SetNumber             setnumber 
StringVal             \"[a-zA-Z]+\"
Semicolon             ;


%%


{StringVal}           {yylval.str = yytext.ToString(); return (int)(Tokens.STRINGVAL);}
{SetString}           return (int)(Tokens.SETSTRING);
{SetNumber}           return (int)(Tokens.SETNUMBER);
{ScreenOut}           return (int)(Tokens.SCREENOUT);

\n|\r\n?              return (int)(Tokens.NR);
{Semicolon}           return (int)(Tokens.SEMICOLON);
{alpha}               {yylval.valname=yytext.ToString(); return (int)(Tokens.RAWSTRING);}
{digits}              {yylval.num=Double.Parse(yytext); return (int)(Tokens.DIGIT);}
<<EOF>>               {Console.Write("meet end of file");}
%%